package cn.medemede.servlet.action;

import cn.medemede.dao.RegionDao;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Region implements Action {
    @Override
    public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
        if(request.getParameter("citySelected")!=null){
            System.out.println("====>"+request.getParameter("citySelected"));
            return RegionDao.selectByCity(request.getParameter("citySelected"),request.getParameter("parentId"));
        }else {
            String parentId = request.getParameter("parentId");
            return RegionDao.select(parentId);
        }
    }
}
